package com.hapzxb.thread.func.f;

public class FunctionalAnnotation {

    public String goodbye(String arg) {
        return "Goodbye, " + arg;
    }
    public static void main(String[] args) {
        FunctionalAnnotation fa = new FunctionalAnnotation();
        Functional f = fa::goodbye;
        FunctionalNoAnn fna = fa::goodbye;
        // Functional fac = fa; // Incompatible
        System.out.println(f.goodbye("Functional"));
        System.out.println(fna.goodbye("FunctionalNoAnn"));
        Functional fl = a -> "Goodbye, " + a;
        FunctionalNoAnn fnal = a -> "Goodbye, " + a;
        System.out.println(fl.goodbye("Functional"));
        System.out.println(fnal.goodbye("FunctionalNoAnn"));
    }
}
